﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="GTR.News.AdminWeb.Login" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <link rel="stylesheet" href="css/font-awesome.min.css"/>
    <link rel="stylesheet" href="css/loginMy.css"/>
    <script src="js/jquery-1.7.2-min.js"></script>
<style>
html,body{width:100%;}
</style>

</head>
<body>

<div class="main">

	<div class="center">
		<form  id="formOne" method="post"onsubmit="return submitB()" >
			<i class="fa fa-user Cone">  | </i>
			<input type="text" name="uer" id="user" placeholder="用户名"onblur="checkUser()"/>
			<span id="user_pass"></span>
			<br/>
			<i class="fa fa-key Cone">  | </i>
			<input type="password" name="pwd" id="pwd" placeholder="密码"onblur="checkUser1()"/>
			<span id="pwd_pass"></span>
			<br/>
			<i class="fa fa-folder-open Cone">  | </i>
			<input type="text" name="surePwd"  placeholder="验证码"onblur="checkUser2()"/>
            
			<span id="surePwd_pass" ></span><br/>
			<input type="button" value="登录" id="submit" name="submit" onclick="UserLogin()"/>
			<br/>
		</form>
	</div>
	
</div>


<script type="text/javascript" src="js/loginMy.js"></script>
<div style="text-align:center;">
<p>GTR@股份有限公司</p>
</div>
</body>
</html>
<script>
    function UserLogin()
    {
        //$("#user").val();
        //$("#pwd").val();

        $.ajax({

            url: "Handler/AdminLogin.ashx",
            type: "post",
            data: {
                name: $("#user").val(),
                pwd: $("#pwd").val()
            },
            success: function (data) {
                if(data==0)
                {
                    alert('用户不存在');
                }
                else
                {
                    if(data==1)
                    {
                        alert('登录成功');
                        location.href='index.aspx'
                    }
                    else
                    {
                        alert('密码错误');
                    }
                }
            }
        });
    }
</script>